package org.jtb.quickr;

import java.io.InputStream;
import java.util.Map;
import org.apache.log4j.Logger;

class PeopleGetUploadStatusRequest extends SignedMethodRequest {
    private static Logger logger = Logger.getLogger(PeopleGetUploadStatusRequest.class.getName());
    
    private String nsId;
    
    protected PeopleGetUploadStatusRequest(String baseUrl, String apiKey, String secret, AuthResponse.Token authToken, String nsid) throws QuickrException {
        super(baseUrl, apiKey, secret, authToken, "flickr.people.getUploadStatus");
        this.nsId = nsid;
    }
        
    protected Map<String,String> getArgs() {
        putArg("user_id", nsId);      
        
        return super.getArgs();
    }

    public UserResponse execute() throws QuickrException {
        FlickrUrl furl = new SignedMethodUrl(getBaseUrl(), getArgs(), getApiKey(), getSecret(), getAuthToken(), getMethod());
        Get get = new Get(furl.getUrl());
        InputStream is = get.execute();

        UserResponse ur = new UserResponse(is);
        
        return ur;
    }
}
